package cn.mw.cmdb.link.enums;

/**
 * @description 线路取数枚举
 */
public enum LinkFetchPortEnum {
    ROOT("ROOT","源设备"),
    TARGET("TARGET","目标设备"),
    ;

    private String type;

    private String desc;

    public String getType() {
        return type;
    }


    public String getDesc() {
        return desc;
    }

    LinkFetchPortEnum(String type, String desc) {
        this.type = type;
        this.desc = desc;
    }

    public static LinkFetchPortEnum getLinkFetchPortEnum(String type) {
        for (LinkFetchPortEnum linkFetchPortEnum : values()) {
            if (type.equals(linkFetchPortEnum.getType())) {
                return linkFetchPortEnum;
            }
        }
        return null;
    }

    public static String getLinkFetchPortType(String desc) {
        for (LinkFetchPortEnum linkFetchPortEnum : values()) {
            if (desc.equals(linkFetchPortEnum.getDesc())) {
                return linkFetchPortEnum.getType();
            }
        }
        return null;
    }
}
